<!-- /* Description for file.
 * 公司共享文档-上传文件(新建文件夹的父窗口)
 *
 * @copyright     Copyright 2008-2010, PHInfo Services Inc. (http://www.phinfoservices.com)
 * @package       ues
 * @subpackage    ues/app/views/filecompanyshares
 * @since         ues
 * @version       V0.0.1
 * @modifiedby    张海杰2011年0629
 * @lastmodified  张海杰2011年0629
 */-->
 
<?php
//echo $javascript->link ( 'jquery' );
echo $html->css ( 'jquery-validate/css/screen' );
echo $html->css ( 'tab' );
echo $html->css ( 'style' );
echo $html->css('start/jquery-ui-1.8.2.custom');
echo $javascript->link('jquery-1.4.2');
echo $javascript->link('jquery-ui-1.8.2.custom.min');
echo $javascript->link ( 'jquery-validate/jquery.validate');
echo $javascript->link ( 'jquery-validate/additional-methods');
echo $javascript->link ( 'jquery-validate/localization/messages_cn');
?> 

<script type="text/javascript">
//添加验证
$(document).ready(function() {
	$.validator.setDefaults({       
		 submitHandler: function(form) {    
		  form.submit();    
		}       
	});   
			
	$("#FilecompanyshareAddfileForm").validate({ 
		rules: {
		"data[Filecompanyshare][fileSpecification]" :{
			required: false,alowsome:true,stringMinLength:0,stringMaxLength:200
			}//文件说明
		},
		messages:{},
		focusInvalid:false,
		onkeyup:false,
		errorPlacement:function(error, element){error.appendTo(element.parent());}
	});

	$("#FilecompanyshareAddfoldForm").validate({
		rules: {
		"data[Filecompanyshare][fileName]":{
			required: true,alowsome:true,stringMinLength:0,stringMaxLength:200
			}//
		},
		messages:{},
		focusInvalid:false,
		onkeyup:false,
		errorPlacement:function(error, element){error.appendTo('p');}
	});
});
//验证结束
</script>

<script>
	$(document).ready(function(){
		$("#btnaddfold").click(function(){
			$(".toolbarStyle").toggle();
			});
		$("#cancel").click(function(){
			$(".toolbarStyle").toggle();
			});	
	});
</script>

<!-- 当前位置-->
<div id="tabmenubar">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td class="tabmenubartitle1"><?php echo  __('YourPosition');//您现在的位置：?></td>
		<td class="tabmenubartitle2"><?php echo __('Personal Office');//一级目录
										   echo '>';echo __('Filecompanyshares');//二级目录
										   echo '>';?>
									<?php echo $html->tag('span', __('Add Filepersonal',true));//当前操作地用span加粗?> 						  
		</td>
	</tr>
</table>
</div>
<!-- 当前位置-->
<div class="tabflex">
<?php echo $form->create('Filecompanyshare',array('action'=>'addfile','type'=> 'post','enctype'=>'multipart/form-data'));?>
	<fieldset>
 		<legend><?php __('Add Filepersonal');?></legend>
 	<table width="100%" cellspacing="0" cellpadding="0" border="0" style="text-align: left">
	<tr>
		<td width="50"></td>
		<td width="100"><?php __('Filepersonaltitletype');//分类?>:</td>
		<td><input type="text" value="公司共享" disabled="disabled" class="TextBoxL txtOut"></input></td>
		<td width="30%"></td>
	</tr>
	<tr>
		<td width="50"></td>
		<td width="100"><?php __('FilepersonalSelectFather');//选择父目录?>:</td>
		<td>
		 <table width="100%" cellspacing="0" cellpadding="0" border="0" style="text-align: left">
		 	<tr>
		 	<td width="180px">
			<?php $options = array('0'=>'--');
				foreach($folds as $eachrecord)
								{					
									$options[$eachrecord['Filecompanyshare']['id']] = $eachrecord['Filecompanyshare']['fileName'];
								}
								echo $form->input('fatherId',array('options'=>$options,'label'=>false,'div'=>false,'class'=>'TextBoxE1','default' =>0));					
					//下拉菜单?>
			</td>
			<td width="100px">
			<a id="btnaddfold"><?php echo $html->image('newfold.gif', 
		 							array('alt' =>  __('Add', true),'title'=> '新建文件夹','border'=>'0','id'=>'btnaddfold')); ?>&nbsp;新建文件夹</a>
			</td>
			<td></td>
			</tr>
		</table>
		</td>
		<td width="30%"></td>
	</tr>	
	<tr>
		<td width="50"></td>
		<td width="100"><?php __('FilepersonalUpload');//选择上传文件?>:</td>
		<td><?php echo $form->file('filecompanysharesfile',
			array('name'=>'filecompanysharesfile','id'=>'filecompanysharesfile','class' => 'TextBoxL','size'=>50,'enctype'=>'multipart/form-data')); ?>
		</td>
		<td width="30%"></td>
	</tr>
	<tr>
		<td width="50"></td>
		<td width="100"><?php __('FilepersonalSpecification');//文件说明?>:</td>
		<td><?php echo $form->textarea('fileSpecification',
			array('class' => 'areaStyle txtOut','label'=>false)); ?></td>
		<td width="30%"></td>
	</tr>
	</table>
	</fieldset>
	<table width="350px" cellspacing="0" cellpadding="0" border="0" style="text-align: left">
	<tr>
		<td width="50"></td>
		<td width="100"><?php 
			$url = ROOT_WEB_PATH . '/filecompanyshares/index/';
			echo $form->button('取消上传',array('type'=>'button','class'=>'btn4','onclick'=>'window_location_href("'.$url.'")'));?>  <!-- 返回-->
		</td>
		<td width="100"><?php echo $form->button('重置',array('type'=>'reset','class'=>'btn2'));?>  <!-- __('reset', true)重置-->
		</td>
		<td width="100"><?php echo $form->button('确定',array('type'=>'submit','class'=>'btn2'));?> 
		</td>
		<td></td>
	</tr>
	</table>
		<?php echo $form->end();?>	
</div>

<!--新建文件夹页面-->
<div class="toolbarStyle" style="display:none">
<?php echo $form->create('Filecompanyshare',array('action'=>'addfold','type'=> 'post'));?>
<table width="100%"  height="90px" cellspacing="0" cellpadding="0" border="0" style="text-align: left">
	<tr>
		<td width="20"></td>
		<td width="100"><?php __('NewFilepersonalFold');//新建文件夹名?>:<font color="red">*</font></td>
		<td><?php echo $form->input('fileName',array('label'=>false)); ?>
		</td>
	</tr>	
	<tr><td width="20"></td><td width="100"></td><td colspan="2"><p id="p"></p></td></tr>
	<tr>
		<td width="20"></td>
		<td width="100"><?php __('FilepersonalSelectFather');//选择父目录?>:</td>
		<td><?php $options = array('0'=>'--');
				foreach($folds as $eachrecord)
								{					
									$options[$eachrecord['Filecompanyshare']['id']] = $eachrecord['Filecompanyshare']['fileName'];
								}
								echo $form->input('fatherId',array('options'=>$options,'label'=>false,'div'=>false,'class'=>'TextBoxE1','default' =>0));					
					//下拉菜单?>
		</td>
	</tr>	
</table>
<table width="100%" cellspacing="0" cellpadding="0" border="0" style="text-align: left">
	<tr>
		<td width="50"></td>
		<td width="100"><?php echo $form->button('关闭',array('type'=>'reset','class'=>'cancelbutton','id'=>'cancel'));?>  <!-- __('reset', true)重置-->
		</td>
		<td width="100"><?php echo $form->button('确定',array('type'=>'submit','class'=>'oksubmit','id'=>'btnajaxAdd'));?> 
		</td>
	</tr>
</table>
	<?php echo $form->end();?>	
</div>

